package com.whjfxx.terminal.commons;

import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * Created by b.c on 2022/4/27 14:23
 */
public class Content {

    /**
     * 菜单根节点父id
     */
    public static final Long ROOT_PID = -1L;


    /**
     * 页面菜单结构key
     */
    public final static class MenuKeys {
        /** title */
        public static final String title = "title";
        /** href */
        public static final String href = "href";
        /** icon */
        public static final String icon = "icon";
        /** target */
        public static final String target = "target";
        /** child */
        public static final String child = "child";
        /** image */
        public static final String image = "image";

        public static final String sort = "sortId";
    }


    public final static class RedisKeys {
        /** 用户登录菜单缓存key */
        public static final String LOGIN_USER_MENU_HKEY = "login_user_menu_hkey";
        /** resource缓存数据 */
        public static final String RESOURCE_KEY = "resource_key";
        /** 用户 密码登录错误次数记录 */
        public static final String USER_LOGIN_ERROR_CNT_PREFIX = "user_login_error_cnt:";
        /** 用户 锁定前缀 */
        public static final String USER_LOGIN_LOCKED_PREFIX = "user_login_locked:";

    }

    /**
     * 设备导入 文件头数据
     */
    public final static String[] TERMINAL_IMPORT_HEADER = {"机构号","应用名称","功能名称","序列号(SN)","型号","激活有效期","长期有效标识","终端状态","商户名称","电话号码","安装地址","安装区县"};


    @Data
    @Component
    public static class FileConfig {

        public static String BASE_PATH;

        @Value("${file.base.path}")
        public void setBasePath(String basePath) {
            BASE_PATH = basePath;
        }
    }

}
